#include"comm.hpp"
#include<unistd.h>
int main()
{
    key_t k =getkey();
    cout<<"server key :"<<toHex(k)<<endl;

    int shmid=createShm(k,gsize);
    cout<<"server shmid :"<<shmid<<endl;

    sleep(5);

    struct shmid_ds ds;
    int n=shmctl(shmid,IPC_STAT,&ds);
    if(n!=-1)
    {
        cout<<"key: "<<toHex(ds.shm_perm.__key)<<endl;
        cout<<"creater pid: "<<ds.shm_cpid<<" : "<<getpid()<<endl;
    }








    //delShm(shmid);
    return 0;
}